import request from '@/utils/request'
import qs from 'qs'

/**
 * =====================默认下单模块======================
 */

// 获取默认菜品列表
export function getDefaultFoodList () {
  return request({
    url: '/food/default_food/default_food_list',
    method: 'get',
    params: {
      storeId: sessionStorage.getItem('storeId')
    }
  })
}

/**
 * 添加默认菜品
 */
// export function addDefaultFood (foodIds, counts) {
//   return request({
//     url: '/food/default_food/add',
//     method: 'post',
//     data: qs.stringify({
//         storeId: sessionStorage.getItem("storeId"),
//         foodIds, counts
//       }, {indices: false}
//     )
//   })
// }
export function addDefaultFood (foodAndCounts) {
  return request({
    url: '/food/default_food/add',
    method: 'post',
    data: qs.stringify({
        storeId: sessionStorage.getItem('storeId'),
        foodAndCounts,
      }, {indices: false}
    )
  })
}

